#include "GpsSerializer.h"

int GpsSerializer::serialize(int messageType, char * message)
{
	return 0;
}

int GpsSerializer::deseralize(int messageType, const std::string & message)
{
	rapidjson::Document doc;
	doc.Parse(message.c_str());
	assert(doc.IsObject());

	gpsinfo.lat = doc["lat"].GetDouble();
	gpsinfo.lon = doc["lon"].GetDouble();
	gpsinfo.roll = doc["roll"].GetDouble();
	gpsinfo.pitch = doc["pitch"].GetDouble();
	gpsinfo.yaw = doc["heading"].GetDouble();

	return 0;
}
